Skip to content

GROOVY-12026: Graduate JavaShell from incubating to stable#2550

Merged
daniellansun merged 1 commit into
apache:masterfrom
paulk-asert:groovy12026
May 23, 2026
Merged

GROOVY-12026: Graduate JavaShell from incubating to stable#2550
daniellansun merged 1 commit into
apache:masterfrom
paulk-asert:groovy12026

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Graduates org.apache.groovy.util.JavaShell to a stable API surface (no longer class-level @Incubating) and adds user/testing documentation plus executable spec examples demonstrating in-memory Java compilation and optional .class file emission.

Changes:

  • Removes @Incubating from JavaShell and scopes @Incubating to the compileAllTo overloads only.
  • Documents JavaShell usage in the integration guide and testing guide with executable src/spec/test examples.
  • Documents Groovy Console’s “Run/Compile as Java” actions and ties them to JavaShell-backed compilation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
subprojects/groovy-console/src/spec/doc/groovy-console.adoc Adds “Running and compiling as Java” section for groovyConsole.
src/spec/test/testingguide/JavaShellExampleTests.groovy Adds executable snippets (tagged includes) for testing-guide documentation.
src/spec/test/IntegrationTest.groovy Adds executable integration-guide snippets covering compile, compileAll, compileAllTo.
src/spec/doc/guide-integrating.adoc Adds a new “JavaShell” section explaining runtime Java compilation and APIs.
src/spec/doc/core-testing-guide.adoc Adds a “JavaShell” subsection showing testing use cases and includes examples.
src/main/java/org/apache/groovy/util/JavaShell.java Removes class-level incubation; marks only compileAllTo overloads as incubating.
Comments suppressed due to low confidence (1)

src/main/java/org/apache/groovy/util/JavaShell.java:246

  • Now that JavaShell is no longer @Incubating, it should fail predictably on a JRE. ToolProvider.getSystemJavaCompiler() can return null, and the current implementation will NPE when calling compiler.getStandardFileManager(...). Consider adding an explicit null check (e.g., throw an IllegalStateException with a clear message about requiring a JDK) before proceeding with compilation.
    @Incubating
    public Map<String, Path> compileAllTo(String className, Iterable<String> options,
                                           String src, Path outputDir)
        throws IOException {
        doCompile(className, src, options);                 // populates jscl's classMap

Comment thread subprojects/groovy-console/src/spec/doc/groovy-console.adoc
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 22, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.1855%. Comparing base (57406e5) to head (72c37f0).

Files with missing lines Patch % Lines
...rc/main/java/org/apache/groovy/util/JavaShell.java 0.0000% 1 Missing and 1 partial ⚠️
...e/src/main/groovy/groovy/console/ui/Console.groovy 0.0000% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2550        +/-   ##
==================================================
+ Coverage     68.1850%   68.1855%   +0.0005%     
- Complexity      32960      32963         +3     
==================================================
  Files            1504       1504                
  Lines          125796     125798         +2     
  Branches        22762      22763         +1     
==================================================
+ Hits            85774      85776         +2     
  Misses          32457      32457                
  Partials         7565       7565                
Files with missing lines Coverage Δ
...e/src/main/groovy/groovy/console/ui/Console.groovy 0.0000% <0.0000%> (ø)
...rc/main/java/org/apache/groovy/util/JavaShell.java 84.1463% <0.0000%> (-2.1037%) ⬇️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 22, 2026

✅ All tests passed ✅

🏷️ Commit: 72c37f0
▶️ Tests: 99519 executed
⚪️ Checks: 28/28 completed


Learn more about TestLens at testlens.app.

@daniellansun daniellansun merged commit 5d09bb5 into apache:master May 23, 2026
29 checks passed
@daniellansun
Copy link
Copy Markdown
Contributor

Merged. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants